<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>用户信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../assets/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../js/formSelects/formSelects-v4.css">
    <style>
        .thumb {margin-left:5px; margin-top:15px; height:128px}
        #prevModal {width:100%; height:100%; text-align:center; display:none;}
        #img_prev {max-width:98%; max-height:98%; margin: 10px auto}
    </style>
</head>

<body>
<fieldset class="layui-elem-field layui-field-title" style="padding-top: 5px;border: hidden">
    <form class="layui-form" action="" lay-filter="dataForm">
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color: red;">*</span>账号</label>
                    <div class="layui-input-block">
                        <input type="text" name="userId"  readonly class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color: red;">*</span>用户名</label>
                    <div class="layui-input-block">
                        <input type="text" name="userName" readonly   class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span style="color: red;">*</span>性别</label>
                    <div class="layui-input-block">
                        <input type="text" name="sex" readonly class="layui-input">
                    </div>
                </div>
            </div>
            <!--<div class="layui-col-md6">-->
                <!--<div class="layui-form-item layui-form-text">-->
                    <!--<label class="layui-form-label">头像</label>-->
                    <!--<div class="layui-upload layui-input-block">-->
                        <!--<img class="layui-upload-img" id="imgPreview" width="100px" height="80px">-->
                    <!--</div>-->
                <!--</div>-->
            <!--</div>-->
        </div>
        <div class="layui-form-item layui-col-md11 layui-col-sm11" pane="">
            <label class="layui-form-label">角色</label>
            <div class="layui-input-block">
                <input type="text" id="iptRoleId" name="roleNames" readonly class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-col-md11 layui-col-sm11" pane="">
            <label class="layui-form-label">部门</label>
            <div class="layui-input-block">
                <input type="text" name="deptName"  class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item layui-col-md11 layui-col-sm11">
            <label class="layui-form-label">身份证号</label>
            <div class="layui-input-block">
                <input type="text" name="code" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item layui-col-md11 layui-col-sm11">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-block">
                <input type="text" name="mail" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item layui-col-md11 layui-col-sm11">
            <label class="layui-form-label">手机</label>
            <div class="layui-input-block">
                <input type="tel" name="phone" class="layui-input" readonly>
            </div>
        </div>
        <div class="layui-form-item layui-form-text layui-col-md11 layui-col-sm11">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="remarks" class="layui-textarea" readonly></textarea>
            </div>
        </div>
    </form>
    <div id='prevModal'>
        <img id='img_prev'/>
    </div>
</fieldset>
<script src="../assets/layui/layui.js"></script>
<script>
    layui.config({
        base: '../js/'
    });
    layui.use(['jquery','form','common'], function () {
        var form = layui.form,
            $ = layui.jquery,
            common = layui.common;
        var id = common.getUrlParam("id");

        //获取用户信息
        $.ajax({
            url: "user/info",
            dataType: "json",
            data: { id: id },
            success: function (rtn) {
                if (rtn && rtn.code===0) {
                    var data = rtn.data;
                    form.val('dataForm',{
                        userId:data.userId,
                        userName:data.userName,
                        sex:data.sex,
                        roleNames:data.roleNames,
                        deptName:data.deptName,
                        mail:data.mail,
                        phone:data.phone,
                        code:data.code,
                        remarks:data.remarks
                    });
                }
            }
        });
    })
</script>
</body>
</html>

